Imports pixolut.BizBlox

Public Class LunchOrderCollection
    Inherits DOCollection

'START BizBlox Generated Code : Do not remove or alter this comment
'Last Updated : Tuesday, 24 August 2004 4:01:21 PM
'BizBlox Version : 0.9.1.22818
#Region "BizBlox Generated Code"

    Sub New()
        MyBase.New(New DOFactory(New LunchOrder))
    End Sub

    'to typecast your item() property
    Default Public Shadows ReadOnly Property Item(ByVal i As Integer) As LunchOrder
        Get
            Return CType(MyBase.Item(i), LunchOrder)
        End Get
    End Property

#End Region
'END BizBlox Generated Code : Do not remove or alter this comment


    'Example finder method
    '*********************
    Public Sub FindByFood(ByVal FoodID As Guid)
        Dim mySql As SQLBuilder = MyBase.GetSqlBuilder()
        mySql.addWhere(LunchOrder.Columns.FoodID, FoodID.ToString())
        MyBase.Find(mySql)
    End Sub

    Public Sub FindByEmailAndPrice(ByVal email As String, ByVal priceLower As Double, ByVal priceUpper As Double)
        Dim mySql As SQLBuilder = MyBase.GetSqlBuilder()
        mySql.addInnerJoin(LunchOrder.Columns.FoodID, New Food, Food.Columns.FoodID)
        mySql.addInnerJoin(LunchOrder.Columns.StudentID, New Student, Student.Columns.StudentID)
        If email <> "" Then
            Dim sbEmail As New SearchBuilder(email)
            mySql.addSearch(New Student, Student.Columns.Email, sbEmail)
            mySql.addAnd()
        End If
        mySql.AddWhereGTE(New Food, Food.Columns.Price, priceLower)
        mySql.addAnd()
        mySql.AddWhereLTE(New Food, Food.Columns.Price, priceUpper)
        MyBase.Find(mySql)
    End Sub

End Class




